home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
CC_C
/
0574.ZIP
/
GETMAIL.C
< prev
next >
Wrap
C/C++ Source or Header
|
1986-08-11
|
683b
|
34 lines
#include <stdio.h>
main (argc, argv)
int argc;
char *argv[];
{
char c;
int count, nomore;
extern char *mktemp ();
char *tmpname, tmp[20];
char buf[BUFSIZ];
char to[BUFSIZ];
FILE *input;
FILE *output;
tmpname = mktemp ("sparkXXXXXX");
output = fopen (tmpname, "w");
strcpy (to, "Who-Knows???");
nomore = count = 0;
while (gets (buf) != NULL)
{
count += strlen (buf) + 1;
fprintf (output, "%s\n", buf);
}
fclose (output);
input = fopen (tmpname, "r");
printf ( "#! MAIL-%s %d\n", argv[1], count);
while (fgets (buf, BUFSIZ, input) != NULL)
printf ( "%s", buf);
fclose (input);
unlink (tmpname);
exit (0);
}